<template>
  <div>
    <h1>Page:Home</h1>
    <router-link to="/home/homeMessage"> to="/home/homeMessage"</router-link>
    <br />
    <br />
    <router-link to="/home/keepMessage"> to="/home/keepMessage"</router-link>
    <!--
       :key="$route.name" 設置唯一的key 值
       $route.meta.keepAlive" 路由設置上是否存在該屬性
-->

    <router-view v-if="!$route.meta.keepAlive"></router-view>
    <p>有緩存的在下面</p>

    <keep-alive v-if="$route.meta.keepAlive" include="KeepDetail">
      <router-view v-if="$route.meta.keepAlive"></router-view>
    </keep-alive>
  </div>

</template>

<script>

export default {
  name: "Home",


}
</script>

<style scoped>
div {
  background: #a1a4d7;
  padding: 10px;
}
</style>